//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using System;

namespace EntLibContrib.Resource.Instrumentation
{
	/// <summary>
	/// Provides data for the <see cref="ResourceInstrumentationProvider.ResourceFailed"/> event.
	/// </summary>
	public class ResourceFailureEventArgs : EventArgs
	{
		#region Fields
		private string errorMessage;
		private Exception exception;
		#endregion

		#region Properties
		/// <summary>
		/// Gets the message that describes the failure.
		/// </summary>
		public string ErrorMessage
		{
			get { return errorMessage; }
		}

		/// <summary>
		/// Gets the message that represents the exception causing the failure.
		/// </summary>
		public Exception Exception
		{
			get { return exception; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ResourceFailureEventArgs"/> class.
		/// </summary>
		/// <param name="errorMessage">The message that describes the failure.</param>
		/// <param name="exception">The exception causing the failure.</param>
		public ResourceFailureEventArgs(string errorMessage, Exception exception)
		{
			this.errorMessage = errorMessage;
			this.exception = exception;
		}
		#endregion
	}
}